<template>
  <div class="hello">
    <h2 style="width: 100%">hello world!</h2>
  </div>
</template>

<script>
// import { dmWidgets } from 'daming-widgets'
import { dmWidgets, dmStrTrim } from "../components/daming-widgets/index";
export default {
  name: "index",
  data() {
    return {
      msg: "",
      datasource: [
        {
          id: 1,
          path: "/nested",
          title: "Nested",
          name: "name1",
          pId: 0,
          children: [
            {
              id: 2,
              path: "/nested/menu1",
              title: "Menu1",
              name: "name2",
              pId: 1,
              children: [
                {
                  id: 4,
                  path: "/nested/menu1/menu1-1",
                  title: "Menu1-1",
                  name: "name1-1",
                  pId: 2,
                },
                {
                  id: 5,
                  path: "/nested/menu1/menu1-2",
                  title: "Menu1-2",
                  name: "name1-2",
                  pId: 2,
                },
                {
                  id: 6,
                  path: "/nested/menu1/menu1-3",
                  title: "Menu1-3",
                  name: "name1-3",
                  pId: 2,
                },
              ],
            },
            {
              id: 3,
              path: "/nested/menu2",
              title: "Menu2",
              name: "name3",
              pId: 1,
            },
          ],
        },
      ],
    };
  },
  created() {
    // alert(dmWidgets.dmRandomStr(5))
    // let c =  dmWidgets.dmFindParent(this.datasource,'Menu1-3','title','children',false)
    // console.log(c)
    // let a =  dmWidgets.dmFindParent(this.datasource,6,'id','children',true)
    // let b =  dmWidgets.dmFindChild(this.datasource,2,'id','children',false)
    // console.log(11111111111,a)
    // console.log(11111111112,b)
    
    alert(dmWidgets.dmPwStrength("111111"));

    // alert(dmWidgets.dmTimeToTimestamp("2022-04-23 18:55:49:123", "m"));
    // alert(dmWidgets.dmTimestampToTime(1650711410));

    var arr = [
      {
        id: 1,
        type: "2",
      },
      {
        id: 1,
        type: "3",
      },
      {
        id: 1,
        type: "2",
      },
      1,
      2,
      1,
    ];
    console.log(dmWidgets.dmDuplicateArr(arr));
  },
  methods: {},
};
</script>

<style scoped>
</style>
